/*
* @Author: Administrator
* @Date:   2017-08-14 10:17:54
* @Last Modified by:   Administrator
* @Last Modified time: 2017-08-16 10:24:39
*/

'use strict';

require('./index.css');
require('util/swiper/index.js');
var _common = require('util/common.js');

var page = {
    init: function(){
        // 初始化加载homepage
        require('../homepage/index.js');
        this.bindEvent();
    },
    bindEvent : function(){
        // 底部导航切换加载js
        $('.weui-tabbar .weui-tabbar__item').on('click',function(){
            switch ($(this).attr('href')) {
                case '#course_reserve':
                    // course_reserve
                    require('../course-reserve/index.js');
                    break;
                case '#timetable':
                    // timetable
                    require('../timetable/index.js');
                    break;
                case '#about':
                    // about
                    require('../about/index.js');
                    break;
                default:
                    // homepage
                    require('../homepage/index.js');
                    break;
            }
        })
    }
};

$(function(){
    page.init();
});